package com.example.eduservice.controller;

import com.example.commonutils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/eduservice/user")
@Slf4j
@CrossOrigin //解决跨越问题
public class EduLoginController {
    //登录
    @PostMapping("login")
    public R login(){
        return R.ok().data("token","admin");
    }
    //返回的消息
    @GetMapping("info")
    public R info() {
        return R.ok().data("roles","[admin]").data("name","admin").data("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
    }
    //退出功能
    @PostMapping("logout")
    public R logout(){
        return R.ok();
    }

}
